package com.kfm.pm;

import java.util.Scanner;

public class Exec04 {

    public static void main(String[] args) {
        // 洪乞丐干10天，收入是多少？
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要计算几天的收入");
        int day = sc.nextInt();
        int sum = 0; // 总收入
        int salary = 1; // 每天的收入
        for (int i = 1; i <= day; i++) { // i 第几天
            sum += salary;
            salary *= 2;
        }
        System.out.println("总收入" + sum);
//        System.out.println(new Random().nextInt(39) + 1);
    }
}
